% Introduction

\chapter{Case of Study} % Main chapter title

\label{Chapter 4} % For referencing the chapter elsewhere, use \ref{Chapter1} 

\lhead{Chapter 4. \emph{Case of Study}} % This is for the header on each page - perhaps a shortened title

%\citep{Reference3}

One goal of this work is to apply the \textbf{Data Layer migration process} that have been identified in the previous chapter. To do this, the Web application \textbf{Research and Technological Collaboration Portal} (RTCP) and its Data Layer is used as a Case of Study. The objective of this charter is to provide a general description of the Case of Study.

\section{Research and Technological Collaboration Portal}

The Web Application Research and Technological Collaboration Portal is a digital platform that permits the articulation of Universities of Italy with Universities of Argentina allowing the possibility of exchanging information that could support research and technology transfer between establishments. It provides functionalities for teaching and research. The application consists in five modules called: \textbf{Users}, \textbf{Projects}, \textbf{Exchange Programs}, \textbf{Technology Transfer} and \textbf{News}. 

The \textbf{Users} module manages the personal data and information regarding research experience, graduate studies, work experience and lines of investigation of interest for two different type of users: Teachers and Students. Furthermore, the system provides the Administrator user, which manages the users and other activities related to a particular university and the CUIA user, who is the main user and has control over all users and activities that link different universities.

The \textbf{Projects} module allows Teacher and Student users the possibility to enroll to a project as two possible participation roles. Those are Participant and Supervisor. The Supervisor users is able to publish a new project. Register users (students, teachers) as Participants role in a specific project and update information regarding projects that manages. The Participants users who belong to a specific project can explore the content of the projects and update information related to the project he is involved.

The \textbf{Exchange Program} module allows CUIA user to publish exchange programs between two universities as well as uploading the pertinent agreement and also publish mobility program proposals.

The \textbf{Technology Transfer}, provides a catalog of Technological Offerings that universities have. Technology transfer consists of publication of patents and software by teachers and publication of devices needed and provided by university administrators.

Finally, by using the \textbf{News} module, the CUIA user can publishes news in order to share information among involved universities.

A useful way to show the complexity of the RTCP web application is through its class diagram.

\begin{figure}[htbp]
	\centering
		\includegraphics[width=0.8\textwidth]{Figures/diagram_class.png}
		\rule{30em}{0.5pt}
	\caption[RTCP Class Diagram.]{RTCP Class Diagram.}
	\label{fig:diagram_class}
\end{figure} 

As the above class diagram shows, the RTCP web application has a number of complex relationships among different entities. 

\section{Tools and Technologies}

RTCP is a Java Enterprise application running on a Glassfish server. Currently, this application is allocate on-premise in a centralized client-server architecture. The main tools used for build this application are listed bellow:

\begin{enumerate}
	\item Application server: Glassfish 4.
	\item Database server: PostgreSQL 9.2.4
	\item Programing language: Java Enterprise Edition.
	\item Persistence Provider: EclipseLink persistence provider and JPA 2.0.
	\item GUI framework: Java Server Faces 2.0.
\end{enumerate}

\section{Architecture}

As a typical Java EE application, RTCP is based in a distributed multitiered application model \citep{Reference65}. The tiers are the following:

\begin{enumerate}
	\item Client-tier - for components run on the client machine.
	\item Web-tier - for components run on the Java EE server.
	\item Business-tier - for components run on the Java EE server.
	\item Enterprise information system (EIS)-tier - for software running on the EIS server.
\end{enumerate}

The figure \ref{fig:java_ee_tiers} shows two multitiered Java EE applications divided into the tiers described in the above list.

\begin{figure}[H]
	\centering
		\includegraphics[width=0.5\textwidth]{Figures/java_ee_tiers.png}
		\rule{30em}{0.5pt}
	\caption[Java EE Tiers.]{Java EE Tiers.}
	\label{fig:java_ee_tiers}
\end{figure}

Currently, the Web-tier, Business-tier and EIS-tier of the RTCP are running together on a single on-premise server.

On the other hand, RTCP has a multilayered design as is shown in the figure \ref{fig:web_portal_layers}.

\begin{figure}[H]
	\centering
		\includegraphics[width=0.6\textwidth]{Figures/web_portal_layers.png}
		\rule{30em}{0.5pt}
	\caption[Multilayered design of the RTCP.]{Multilayered design of the RTCP.}
	\label{fig:web_portal_layers}
\end{figure}

As the figure \ref{fig:web_portal_layers} shows, RTCP make uses of JPA technology in order to provides a POJO persistence model for object-relational mapping. Thus, JPA plays the role of Data Access Layer since it enables an abstraction layer to perform queries to the database. Furthermore, DAO Java EJB beans are using to provide an extension of the JPA abstraction. Queries in RTCP are formulated as Java objects, which are translated by JPA to the SQL language of the underlying database. Thus, it architecture allows the application to be independent of the kind of SQL database.

From a lower level point of view, the interaction between the Data Access Later and Business Later, can be seen as follows:

\begin{figure}[H]
	\centering
		\includegraphics[width=0.8\textwidth]{Figures/RTCP_data_layer_and_business_layer.png}
		\rule{30em}{0.5pt}
	\caption[Interaction between the Data Access Layer and the Business Layer.]{Interaction between the Data Access Layer and the Business Layer.}
	\label{fig:RTCP_data_layer_and_business_layer}
\end{figure}






